package xyx.springboot.mapper;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import xyx.springboot.model.User;

import java.util.Map;

@Repository
public interface JpaMapper extends JpaRepository<User,Integer>{

    public User getById(int id);

    @Query(value = "select username as username,password as password from User u where u.id=?1")
    Map myfind(int id);

}
